package entity

import "encoding/json"

type SimCardRechargeRecord struct {
	Id             int64           `gorm:"column:id;primary_key" json:"id"`
	EbikeId        int64           `gorm:"column:ebike_id;type:bigint;comment:车辆ID" json:"ebike_id"`
	CardId         int64           `gorm:"column:card_id;type:bigint;comment:simcard主键ID" json:"card_id"`
	PrepaidId      int64           `gorm:"column:prepaid_id;type:bigint;comment:prepaid 表主键ID" json:"prepaid_id"`
	AgentId        int64           `gorm:"column:agent_id;type:bigint;comment:代理ID" json:"agent_id"`
	AgentDetail    json.RawMessage `gorm:"column:agent_detail;type:json;comment:代理详情" json:"agent_detail"`
	Iccid          string          `gorm:"column:iccid;type:varchar(32)" json:"iccid"`
	RechargeAt     int64           `gorm:"column:recharge_at;type:bigint;comment:充值时间" json:"recharge_at"`
	Status         int             `gorm:"column:status;type:integer;comment:状态" json:"status"`
	Reason         string          `gorm:"column:reason;type:varchar(255)" json:"reason"`
	RechargeDetail json.RawMessage `gorm:"column:recharge_detail;type:json;comment:充值详情" json:"recharge_detail"`
	CreatedAt      int64           `gorm:"column:created_at;type:bigint" json:"created_at"`
	UpdatedAt      int64           `gorm:"column:updated_at;type:bigint" json:"updated_at"`
}

func (s *SimCardRechargeRecord) TableName() string {
	return "sim_card_recharge_record"
}
